#include "stdlib.hpp"
#include <purewell/types.hpp>

namespace purewell
{
__PWFLAG_TYPE PWIO_NONE(0x00);
__PWFLAG_TYPE PWIO_READ(POLLIN);
__PWFLAG_TYPE PWIO_OOB(POLLPRI);
__PWFLAG_TYPE PWIO_WRITE(POLLOUT);
__PWFLAG_TYPE PWIO_ERROR(POLLERR);
__PWFLAG_TYPE PWIO_R(PWIO_READ);
__PWFLAG_TYPE PWIO_W(PWIO_WRITE);
__PWFLAG_TYPE PWIO_E(PWIO_ERROR);
__PWFLAG_TYPE PWIO_RW(PWIO_R|PWIO_W);

__PWFLAG_TYPE PWMUTEX_DEFAULT(PTHREAD_MUTEX_DEFAULT);
__PWFLAG_TYPE PWMUTEX_FAST(PTHREAD_MUTEX_NORMAL);
__PWFLAG_TYPE PWMUTEX_RECURSIVE(PTHREAD_MUTEX_RECURSIVE);
__PWFLAG_TYPE PWMUTEX_ERRORCHECK(PTHREAD_MUTEX_ERRORCHECK);

__PWFLAG_TYPE PWTHREAD_SCOPE_SYSTEM(PTHREAD_SCOPE_SYSTEM);
__PWFLAG_TYPE PWTHREAD_SCOPE_PROCESS(PTHREAD_SCOPE_PROCESS);

__PWFLAG_TYPE PWSA_LOOKUP_NOFULLNAME(NI_NOFQDN);
__PWFLAG_TYPE PWSA_LOOKUP_NOFQDN(NI_NOFQDN);
__PWFLAG_TYPE PWSA_LOOKUP_NUMERICHOST(NI_NUMERICHOST);
__PWFLAG_TYPE PWSA_LOOKUP_NUMERICSERVICE(NI_NUMERICSERV);
__PWFLAG_TYPE PWSA_LOOKUP_NUMERIC(NI_NUMERICHOST|NI_NUMERICSERV);
__PWFLAG_TYPE PWSA_LOOKUP_NAMEFORCE(NI_NAMEREQD);
__PWFLAG_TYPE PWSA_LOOKUP_NAMEREQD(NI_NAMEREQD);
__PWFLAG_TYPE PWSA_LOOKUP_DATAGRAM(NI_DGRAM);

__PWFLAG_TYPE PWSOCK_FAM_IP(PF_INET);
__PWFLAG_TYPE PWSOCK_FAM_IP4(PF_INET);
__PWFLAG_TYPE PWSOCK_FAM_IP6(PF_INET6);
__PWFLAG_TYPE PWSOCK_FAM_UNSPEC(PF_UNSPEC);
__PWFLAG_TYPE PWSOCK_FAM_UNKNOWN(PF_UNSPEC);
__PWFLAG_TYPE PWSOCK_FAM_FILE(PF_LOCAL);

__PWFLAG_TYPE PWSOCK_STREAM(SOCK_STREAM);
__PWFLAG_TYPE PWSOCK_DATAGRAM(SOCK_DGRAM);

__PWFLAG_TYPE PWSO_LAZY(RTLD_LAZY);
__PWFLAG_TYPE PWSO_NOW(RTLD_NOW);
__PWFLAG_TYPE PWSO_GLOBAL(RTLD_GLOBAL);

__PWFLAG_TYPE PWFILE_MODE_READONLY(O_RDONLY);
__PWFLAG_TYPE PWFILE_MODE_WRITEONLY(O_WRONLY);
__PWFLAG_TYPE PWFILE_MODE_RW(O_RDWR);
__PWFLAG_TYPE PWFILE_MODE_CREATE(O_CREAT);
__PWFLAG_TYPE PWFILE_MODE_EXCLUSIVE(O_EXCL);
__PWFLAG_TYPE PWFILE_MODE_TRUNCATE(O_TRUNC);
__PWFLAG_TYPE PWFILE_MODE_SYNC(O_SYNC);
__PWFLAG_TYPE PWFILE_MODE_ASYNC(O_ASYNC);
__PWFLAG_TYPE PWFILE_MODE_APPEND(O_APPEND);
__PWFLAG_TYPE PWFILE_MODE_LARGEFILE(O_LARGEFILE);
__PWFLAG_TYPE PWFILE_MODE_NONBLOCK(O_NONBLOCK);

__PWFLAG_TYPE PWFILE_SEEK_CURRENT(SEEK_CUR);
__PWFLAG_TYPE PWFILE_SEEK_START(SEEK_SET);
__PWFLAG_TYPE PWFILE_SEEK_END(SEEK_END);

__PWFLAG_TYPE PWMEM_OMODE_EXEC(PROT_EXEC);
__PWFLAG_TYPE PWMEM_OMODE_READ(PROT_READ);
__PWFLAG_TYPE PWMEM_OMODE_WRITE(PROT_WRITE);
__PWFLAG_TYPE PWMEM_OMODE_NONE(PROT_NONE);
__PWFLAG_TYPE PWMEM_OMODE_DEFAULT(PROT_READ|PROT_WRITE);

__PWFLAG_TYPE PWMEM_FILE_FORCE(MAP_FIXED);
__PWFLAG_TYPE PWMEM_FILE_SHARED(MAP_SHARED);
__PWFLAG_TYPE PWMEM_FILE_PRIVATE(MAP_PRIVATE);
__PWFLAG_TYPE PWMEM_FILE_DEFAULT(MAP_PRIVATE);

#if defined (WIN32)
const char PWDIR_DELIMITER[4] = "\\";
#else
const char PWDIR_DELIMITER[4] = "/";
#endif//WIN32

__PWFLAG_TYPE PWSIGNAL_CODE_USER(SI_USER);
__PWFLAG_TYPE PWSIGNAL_CODE_KERNEL(SI_KERNEL);
__PWFLAG_TYPE PWSIGNAL_CODE_QUEUE(SI_QUEUE);
__PWFLAG_TYPE PWSIGNAL_CODE_TIMER(SI_TIMER);
__PWFLAG_TYPE PWSIGNAL_CODE_MESGQ(SI_MESGQ);
__PWFLAG_TYPE PWSIGNAL_CODE_ASYNCIO(SI_ASYNCIO);
__PWFLAG_TYPE PWSIGNAL_CODE_SIGIO(SI_SIGIO);

};//namespace purewell

